3.4.4 \(\int (f+\frac {g}{x})^2 x^2 (a+b \log (c (d+e x)^n)) \, dx\) [304]

Optimal. Leaf size=120 \[ -\frac {b (d f-e g)^2 n x}{3 e^2}+\frac {b (d f-e g) n (g+f x)^2}{6 e f}-\frac {b n (g+f x)^3}{9 f}+\frac {b (d f-e g)^3 n \log (d+e x)}{3 e^3 f}+\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f} \]

[Out]

-1/3*b*(d*f-e*g)^2*n*x/e^2+1/6*b*(d*f-e*g)*n*(f*x+g)^2/e/f-1/9*b*n*(f*x+g)^3/f+1/3*b*(d*f-e*g)^3*n*ln(e*x+d)/e
^3/f+1/3*(f*x+g)^3*(a+b*ln(c*(e*x+d)^n))/f

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2459, 2442, 45} \begin {gather*} \frac {(f x+g)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}+\frac {b n (d f-e g)^3 \log (d+e x)}{3 e^3 f}-\frac {b n x (d f-e g)^2}{3 e^2}+\frac {b n (f x+g)^2 (d f-e g)}{6 e f}-\frac {b n (f x+g)^3}{9 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(f + g/x)^2*x^2*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

-1/3*(b*(d*f - e*g)^2*n*x)/e^2 + (b*(d*f - e*g)*n*(g + f*x)^2)/(6*e*f) - (b*n*(g + f*x)^3)/(9*f) + (b*(d*f - e
*g)^3*n*Log[d + e*x])/(3*e^3*f) + ((g + f*x)^3*(a + b*Log[c*(d + e*x)^n]))/(3*f)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2459

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)/(x_))^(q_.)*(x_)^(m_.), x_Symbol]
 :> Int[(g + f*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q}, x] && EqQ[m,
q] && IntegerQ[q]

Rubi steps

\begin {align*} \int \left (f+\frac {g}{x}\right )^2 x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx &=\int (g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx\\ &=\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}-\frac {(b e n) \int \frac {(g+f x)^3}{d+e x} \, dx}{3 f}\\ &=\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}-\frac {(b e n) \int \left (\frac {f (-d f+e g)^2}{e^3}+\frac {(-d f+e g)^3}{e^3 (d+e x)}+\frac {f (-d f+e g) (g+f x)}{e^2}+\frac {f (g+f x)^2}{e}\right ) \, dx}{3 f}\\ &=-\frac {b (d f-e g)^2 n x}{3 e^2}+\frac {b (d f-e g) n (g+f x)^2}{6 e f}-\frac {b n (g+f x)^3}{9 f}+\frac {b (d f-e g)^3 n \log (d+e x)}{3 e^3 f}+\frac {(g+f x)^3 \left (a+b \log \left (c (d+e x)^n\right )\right )}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.11, size = 150, normalized size = 1.25 \begin {gather*} \frac {6 b d^2 f (d f-3 e g) n \log (d+e x)+e \left (x \left (6 a e^2 \left (3 g^2+3 f g x+f^2 x^2\right )-b n \left (6 d^2 f^2-3 d e f (6 g+f x)+e^2 \left (18 g^2+9 f g x+2 f^2 x^2\right )\right )\right )+6 b e \left (3 d g^2+e x \left (3 g^2+3 f g x+f^2 x^2\right )\right ) \log \left (c (d+e x)^n\right )\right )}{18 e^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(f + g/x)^2*x^2*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

(6*b*d^2*f*(d*f - 3*e*g)*n*Log[d + e*x] + e*(x*(6*a*e^2*(3*g^2 + 3*f*g*x + f^2*x^2) - b*n*(6*d^2*f^2 - 3*d*e*f
*(6*g + f*x) + e^2*(18*g^2 + 9*f*g*x + 2*f^2*x^2))) + 6*b*e*(3*d*g^2 + e*x*(3*g^2 + 3*f*g*x + f^2*x^2))*Log[c*
(d + e*x)^n]))/(18*e^3)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.30, size = 585, normalized size = 4.88

method result size
risch \(\frac {a \,f^{2} x^{3}}{3}+x a \,g^{2}+\frac {b \,g^{2} n d \ln \left (e x +d \right )}{e}-b \,g^{2} n x +\frac {\left (f x +g \right )^{3} b \ln \left (\left (e x +d \right )^{n}\right )}{3 f}-\frac {f^{2} b n \,x^{3}}{9}+f a g \,x^{2}+\frac {i f^{2} \pi b \,x^{3} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{6}+\frac {i f^{2} \pi b \,x^{3} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{6}-\frac {i f \pi b g \,x^{2} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}+\frac {i \pi b \,g^{2} x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i \pi b \,g^{2} x \,\mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+f \ln \left (c \right ) b g \,x^{2}-\frac {\ln \left (e x +d \right ) b \,g^{3} n}{3 f}+\frac {f^{2} \ln \left (c \right ) b \,x^{3}}{3}+\ln \left (c \right ) b \,g^{2} x +\frac {f^{2} b d n \,x^{2}}{6 e}-\frac {f b g n \,x^{2}}{2}-\frac {f^{2} b \,d^{2} n x}{3 e^{2}}+\frac {f^{2} \ln \left (e x +d \right ) b \,d^{3} n}{3 e^{3}}+\frac {f b d n g x}{e}-\frac {f \ln \left (e x +d \right ) b \,d^{2} g n}{e^{2}}-\frac {i f \pi b g \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {i f^{2} \pi b \,x^{3} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{6}+\frac {i f \pi b g \,x^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {i f \pi b g \,x^{2} \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}-\frac {i \pi b \,g^{2} x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i \left (e x +d \right )^{n}\right ) \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {i f^{2} \pi b \,x^{3} \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{6}-\frac {i \pi b \,g^{2} x \mathrm {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}\) \(585\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f+g/x)^2*x^2*(a+b*ln(c*(e*x+d)^n)),x,method=_RETURNVERBOSE)

[Out]

1/3*a*f^2*x^3+x*a*g^2-1/6*I*f^2*Pi*b*x^3*csgn(I*c*(e*x+d)^n)^3-1/2*I*Pi*b*g^2*x*csgn(I*c*(e*x+d)^n)^3+b*g^2/e*
n*d*ln(e*x+d)-b*g^2*n*x+1/6*I*f^2*Pi*b*x^3*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2+1/6*I*f^2*Pi*b*x^3*csgn(I*(e*x+d)^n
)*csgn(I*c*(e*x+d)^n)^2-1/2*I*f*Pi*b*g*x^2*csgn(I*c*(e*x+d)^n)^3+1/2*I*Pi*b*g^2*x*csgn(I*c)*csgn(I*c*(e*x+d)^n
)^2+1/2*I*Pi*b*g^2*x*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2+1/3*(f*x+g)^3*b/f*ln((e*x+d)^n)-1/9*f^2*b*n*x^3+f
*a*g*x^2+f*ln(c)*b*g*x^2-1/3/f*ln(e*x+d)*b*g^3*n+1/3*f^2*ln(c)*b*x^3+ln(c)*b*g^2*x+1/6/e*f^2*b*d*n*x^2-1/2*f*b
*g*n*x^2-1/3/e^2*f^2*b*d^2*n*x+1/3/e^3*f^2*ln(e*x+d)*b*d^3*n+1/e*f*b*d*n*g*x-1/e^2*f*ln(e*x+d)*b*d^2*g*n-1/6*I
*f^2*Pi*b*x^3*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)+1/2*I*f*Pi*b*g*x^2*csgn(I*c)*csgn(I*c*(e*x+d)^n)
^2+1/2*I*f*Pi*b*g*x^2*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2-1/2*I*Pi*b*g^2*x*csgn(I*c)*csgn(I*(e*x+d)^n)*csg
n(I*c*(e*x+d)^n)-1/2*I*f*Pi*b*g*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 190, normalized size = 1.58 \begin {gather*} \frac {1}{3} \, b f^{2} x^{3} \log \left ({\left (x e + d\right )}^{n} c\right ) + \frac {1}{3} \, a f^{2} x^{3} + \frac {1}{18} \, {\left (6 \, d^{3} e^{\left (-4\right )} \log \left (x e + d\right ) - {\left (2 \, x^{3} e^{2} - 3 \, d x^{2} e + 6 \, d^{2} x\right )} e^{\left (-3\right )}\right )} b f^{2} n e - \frac {1}{2} \, {\left (2 \, d^{2} e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x^{2} e - 2 \, d x\right )} e^{\left (-2\right )}\right )} b f g n e + {\left (d e^{\left (-2\right )} \log \left (x e + d\right ) - x e^{\left (-1\right )}\right )} b g^{2} n e + b f g x^{2} \log \left ({\left (x e + d\right )}^{n} c\right ) + a f g x^{2} + b g^{2} x \log \left ({\left (x e + d\right )}^{n} c\right ) + a g^{2} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)^2*x^2*(a+b*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

1/3*b*f^2*x^3*log((x*e + d)^n*c) + 1/3*a*f^2*x^3 + 1/18*(6*d^3*e^(-4)*log(x*e + d) - (2*x^3*e^2 - 3*d*x^2*e +
6*d^2*x)*e^(-3))*b*f^2*n*e - 1/2*(2*d^2*e^(-3)*log(x*e + d) + (x^2*e - 2*d*x)*e^(-2))*b*f*g*n*e + (d*e^(-2)*lo
g(x*e + d) - x*e^(-1))*b*g^2*n*e + b*f*g*x^2*log((x*e + d)^n*c) + a*f*g*x^2 + b*g^2*x*log((x*e + d)^n*c) + a*g
^2*x

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 195, normalized size = 1.62 \begin {gather*} -\frac {1}{18} \, {\left (6 \, b d^{2} f^{2} n x e - 6 \, {\left (b f^{2} x^{3} + 3 \, b f g x^{2} + 3 \, b g^{2} x\right )} e^{3} \log \left (c\right ) + {\left (2 \, {\left (b f^{2} n - 3 \, a f^{2}\right )} x^{3} + 9 \, {\left (b f g n - 2 \, a f g\right )} x^{2} + 18 \, {\left (b g^{2} n - a g^{2}\right )} x\right )} e^{3} - 3 \, {\left (b d f^{2} n x^{2} + 6 \, b d f g n x\right )} e^{2} - 6 \, {\left (b d^{3} f^{2} n - 3 \, b d^{2} f g n e + 3 \, b d g^{2} n e^{2} + {\left (b f^{2} n x^{3} + 3 \, b f g n x^{2} + 3 \, b g^{2} n x\right )} e^{3}\right )} \log \left (x e + d\right )\right )} e^{\left (-3\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)^2*x^2*(a+b*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

-1/18*(6*b*d^2*f^2*n*x*e - 6*(b*f^2*x^3 + 3*b*f*g*x^2 + 3*b*g^2*x)*e^3*log(c) + (2*(b*f^2*n - 3*a*f^2)*x^3 + 9
*(b*f*g*n - 2*a*f*g)*x^2 + 18*(b*g^2*n - a*g^2)*x)*e^3 - 3*(b*d*f^2*n*x^2 + 6*b*d*f*g*n*x)*e^2 - 6*(b*d^3*f^2*
n - 3*b*d^2*f*g*n*e + 3*b*d*g^2*n*e^2 + (b*f^2*n*x^3 + 3*b*f*g*n*x^2 + 3*b*g^2*n*x)*e^3)*log(x*e + d))*e^(-3)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (102) = 204\).
time = 5.58, size = 252, normalized size = 2.10 \begin {gather*} \begin {cases} \frac {a f^{2} x^{3}}{3} + a f g x^{2} + a g^{2} x + \frac {b d^{3} f^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{3}} - \frac {b d^{2} f^{2} n x}{3 e^{2}} - \frac {b d^{2} f g \log {\left (c \left (d + e x\right )^{n} \right )}}{e^{2}} + \frac {b d f^{2} n x^{2}}{6 e} + \frac {b d f g n x}{e} + \frac {b d g^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {b f^{2} n x^{3}}{9} + \frac {b f^{2} x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{3} - \frac {b f g n x^{2}}{2} + b f g x^{2} \log {\left (c \left (d + e x\right )^{n} \right )} - b g^{2} n x + b g^{2} x \log {\left (c \left (d + e x\right )^{n} \right )} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (\frac {f^{2} x^{3}}{3} + f g x^{2} + g^{2} x\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)**2*x**2*(a+b*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*f**2*x**3/3 + a*f*g*x**2 + a*g**2*x + b*d**3*f**2*log(c*(d + e*x)**n)/(3*e**3) - b*d**2*f**2*n*x/
(3*e**2) - b*d**2*f*g*log(c*(d + e*x)**n)/e**2 + b*d*f**2*n*x**2/(6*e) + b*d*f*g*n*x/e + b*d*g**2*log(c*(d + e
*x)**n)/e - b*f**2*n*x**3/9 + b*f**2*x**3*log(c*(d + e*x)**n)/3 - b*f*g*n*x**2/2 + b*f*g*x**2*log(c*(d + e*x)*
*n) - b*g**2*n*x + b*g**2*x*log(c*(d + e*x)**n), Ne(e, 0)), ((a + b*log(c*d**n))*(f**2*x**3/3 + f*g*x**2 + g**
2*x), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 430 vs. \(2 (112) = 224\).
time = 5.22, size = 430, normalized size = 3.58 \begin {gather*} \frac {1}{3} \, {\left (x e + d\right )}^{3} b f^{2} n e^{\left (-3\right )} \log \left (x e + d\right ) - {\left (x e + d\right )}^{2} b d f^{2} n e^{\left (-3\right )} \log \left (x e + d\right ) + {\left (x e + d\right )} b d^{2} f^{2} n e^{\left (-3\right )} \log \left (x e + d\right ) - \frac {1}{9} \, {\left (x e + d\right )}^{3} b f^{2} n e^{\left (-3\right )} + \frac {1}{2} \, {\left (x e + d\right )}^{2} b d f^{2} n e^{\left (-3\right )} - {\left (x e + d\right )} b d^{2} f^{2} n e^{\left (-3\right )} + {\left (x e + d\right )}^{2} b f g n e^{\left (-2\right )} \log \left (x e + d\right ) - 2 \, {\left (x e + d\right )} b d f g n e^{\left (-2\right )} \log \left (x e + d\right ) + \frac {1}{3} \, {\left (x e + d\right )}^{3} b f^{2} e^{\left (-3\right )} \log \left (c\right ) - {\left (x e + d\right )}^{2} b d f^{2} e^{\left (-3\right )} \log \left (c\right ) + {\left (x e + d\right )} b d^{2} f^{2} e^{\left (-3\right )} \log \left (c\right ) - \frac {1}{2} \, {\left (x e + d\right )}^{2} b f g n e^{\left (-2\right )} + 2 \, {\left (x e + d\right )} b d f g n e^{\left (-2\right )} + \frac {1}{3} \, {\left (x e + d\right )}^{3} a f^{2} e^{\left (-3\right )} - {\left (x e + d\right )}^{2} a d f^{2} e^{\left (-3\right )} + {\left (x e + d\right )} a d^{2} f^{2} e^{\left (-3\right )} + {\left (x e + d\right )} b g^{2} n e^{\left (-1\right )} \log \left (x e + d\right ) + {\left (x e + d\right )}^{2} b f g e^{\left (-2\right )} \log \left (c\right ) - 2 \, {\left (x e + d\right )} b d f g e^{\left (-2\right )} \log \left (c\right ) - {\left (x e + d\right )} b g^{2} n e^{\left (-1\right )} + {\left (x e + d\right )}^{2} a f g e^{\left (-2\right )} - 2 \, {\left (x e + d\right )} a d f g e^{\left (-2\right )} + {\left (x e + d\right )} b g^{2} e^{\left (-1\right )} \log \left (c\right ) + {\left (x e + d\right )} a g^{2} e^{\left (-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)^2*x^2*(a+b*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

1/3*(x*e + d)^3*b*f^2*n*e^(-3)*log(x*e + d) - (x*e + d)^2*b*d*f^2*n*e^(-3)*log(x*e + d) + (x*e + d)*b*d^2*f^2*
n*e^(-3)*log(x*e + d) - 1/9*(x*e + d)^3*b*f^2*n*e^(-3) + 1/2*(x*e + d)^2*b*d*f^2*n*e^(-3) - (x*e + d)*b*d^2*f^
2*n*e^(-3) + (x*e + d)^2*b*f*g*n*e^(-2)*log(x*e + d) - 2*(x*e + d)*b*d*f*g*n*e^(-2)*log(x*e + d) + 1/3*(x*e +
d)^3*b*f^2*e^(-3)*log(c) - (x*e + d)^2*b*d*f^2*e^(-3)*log(c) + (x*e + d)*b*d^2*f^2*e^(-3)*log(c) - 1/2*(x*e +
d)^2*b*f*g*n*e^(-2) + 2*(x*e + d)*b*d*f*g*n*e^(-2) + 1/3*(x*e + d)^3*a*f^2*e^(-3) - (x*e + d)^2*a*d*f^2*e^(-3)
 + (x*e + d)*a*d^2*f^2*e^(-3) + (x*e + d)*b*g^2*n*e^(-1)*log(x*e + d) + (x*e + d)^2*b*f*g*e^(-2)*log(c) - 2*(x
*e + d)*b*d*f*g*e^(-2)*log(c) - (x*e + d)*b*g^2*n*e^(-1) + (x*e + d)^2*a*f*g*e^(-2) - 2*(x*e + d)*a*d*f*g*e^(-
2) + (x*e + d)*b*g^2*e^(-1)*log(c) + (x*e + d)*a*g^2*e^(-1)

________________________________________________________________________________________

Mupad [B]
time = 0.30, size = 212, normalized size = 1.77 \begin {gather*} x^2\,\left (\frac {f\,\left (a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{2\,e}-\frac {d\,f^2\,\left (3\,a-b\,n\right )}{6\,e}\right )+x\,\left (\frac {3\,a\,e\,g^2-3\,b\,e\,g^2\,n+6\,a\,d\,f\,g}{3\,e}-\frac {d\,\left (\frac {f\,\left (a\,d\,f+2\,a\,e\,g-b\,e\,g\,n\right )}{e}-\frac {d\,f^2\,\left (3\,a-b\,n\right )}{3\,e}\right )}{e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,f^2\,x^3}{3}+b\,f\,g\,x^2+b\,g^2\,x\right )+\frac {f^2\,x^3\,\left (3\,a-b\,n\right )}{9}+\frac {\ln \left (d+e\,x\right )\,\left (b\,n\,d^3\,f^2-3\,b\,n\,d^2\,e\,f\,g+3\,b\,n\,d\,e^2\,g^2\right )}{3\,e^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(f + g/x)^2*(a + b*log(c*(d + e*x)^n)),x)

[Out]

x^2*((f*(a*d*f + 2*a*e*g - b*e*g*n))/(2*e) - (d*f^2*(3*a - b*n))/(6*e)) + x*((3*a*e*g^2 - 3*b*e*g^2*n + 6*a*d*
f*g)/(3*e) - (d*((f*(a*d*f + 2*a*e*g - b*e*g*n))/e - (d*f^2*(3*a - b*n))/(3*e)))/e) + log(c*(d + e*x)^n)*((b*f
^2*x^3)/3 + b*g^2*x + b*f*g*x^2) + (f^2*x^3*(3*a - b*n))/9 + (log(d + e*x)*(b*d^3*f^2*n + 3*b*d*e^2*g^2*n - 3*
b*d^2*e*f*g*n))/(3*e^3)

________________________________________________________________________________________